#{extends 'site.html' /} 
#{set title:'Search exam' /}

	<h4>Search exam</h4>

<ul class="addingItem">
	<li>
		#{a @Exams.create()}Or add a new one#{/a}
	</li>
</ul>

#{form @Exams.search()} 

	<p class="bloc_line">
      <label for="email">Candidate email: </label>
      <input type="text" name="email" id="email" value="${email}"/>
   </p>
   <p class="bloc_line">
      <label for="examKey">Key: </label>
      <input type="text" name="examKey" id="examKey" value="${examKey}"/>
   </p>
           
     <p class="bloc_line">
        <input type="submit" value="Search" />
     </p>
  
  #{/form} 
	
<div>
	<table>
		<thead>
			<tr>
            <th>Exam key</th>
            <th>Candidate</th>
            <th>Quiz</th>
            <th>Created</th>
            <th>Time</th>
            <th>State</th>
			</tr>
		</thead>
		<tbody>
		  #{list items:exams, as:'exam'}
			<tr>
				<td>#{a @Exams.view(exam.id)}${exam.examKey}#{/a}</td>
            <td>${exam.candidate}</td>
            <td>${exam.quiz}</td>
            <td>${exam.creationDate.format("yyyy-MM-dd")}</td>
            <td>${exam.second}</td>
            <td>${exam.state}</td>
			</tr>
			#{/list}
			#{else}
			<tr>
			   <td colspan="5" class="no-response">No question. Change filter values.</td>
			</tr>
			#{/else}
		</tbody>
	</table>

</div>








